﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Smart
{
    public partial class frmSettings : Form
    {
        public frmSettings()
        {
            InitializeComponent();
        }

        private void txtDatabase_GotFocus(object sender, EventArgs e)
        {
            Sip.Show();
        }

        private void txtDatabase_LostFocus(object sender, EventArgs e)
        {
            Sip.Hide();
        }

        private void frmSettings_Load(object sender, EventArgs e)
        {
            //txtDatabase.Text = Program.Session[Settings.DatabaseAdi].ToString();
            //txtSunucu.Text = Program.Session[Settings.ServerAdi].ToString();
            //txtUser.Text = Program.Session[Settings.KullaniciAdi].ToString();
            //txtPassword.Text = Program.Session[Settings.Sifre].ToString();
        }

        private void txtSunucu_GotFocus(object sender, EventArgs e)
        {
            Sip.Show();
        }

        private void txtSunucu_LostFocus(object sender, EventArgs e)
        {
            Sip.Hide();
        }

        private void txtUser_GotFocus(object sender, EventArgs e)
        {
            Sip.Show();
        }

        private void txtUser_LostFocus(object sender, EventArgs e)
        {
            Sip.Hide();
        }

        private void txtPassword_GotFocus(object sender, EventArgs e)
        {
            Sip.Show();
        }

        private void txtPassword_LostFocus(object sender, EventArgs e)
        {
            Sip.Hide();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Program.Session[Settings.Veritabani] = txtDatabase.Text;
            Program.Session[Settings.Sunucu] = txtSunucu.Text;
            Program.Session[Settings.VtKullaniciAdi] = txtUser.Text;
            Program.Session[Settings.VtSifre] = txtPassword.Text;
            Program.Session[Settings.ServiceUrl] = txtUrl.Text;
            this.Close();
        }

        private void txtUrl_GotFocus(object sender, EventArgs e)
        {
            Sip.Show();
        }

        private void txtUrl_LostFocus(object sender, EventArgs e)
        {
            Sip.Hide();
        }
    }
}